<?php

namespace App\Models;

use Jenssegers\Mongodb\Eloquent\SoftDeletes;

class Order extends Base
{
    use SoftDeletes;

    const STATUS_WAIT_DELIVER = 1; //待发货
    const STATUS_DELIVER_DONE = 2; //已发货

    public function product_snapshot() {
        return $this->belongsTo(ProductSnapshot::class, 'product_snapshots_id');
    }

    public function address_snapshot() {
        return $this->belongsTo(Address::class, 'address_snapshots_id');
    }

    public function user() {
        return $this->belongsTo(User::class, 'user_id');
    }
}
